{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">增加赠品 [ <a href="__URL__">返回列表</a> ]</h3>
<div id="result" class="result none"></div>
<php>
    $sale = M('Sale')->where('id = '.$_GET['id'])->find();
</php>
<form class="form-horizontal well" method='post' id="form1" name="form1" action="__URL__/gift_insert/">
<table cellpadding=3 cellspacing=3 >
<tr>
	<td class="tRight" >销售单号：</td>
	<td class="tLeft" >
		<input type="hidden" name="sale_id" value="{$_GET.id}">
		<input type="hidden" name="sale_no" value="{$sale.sale_no}">
        <input type="hidden" name="jumpUrl" value="__APP__/Sale/edit/id/{$_GET.id}">
            {$sale.sale_no}  &nbsp;&nbsp; 仓库:{$sale.warehouse_id|getModelName=Warehouse}
            
        </td>
</tr>
<tr>
	<td class="tRight" >经办人：</td>
	<td class="tLeft" >
            {$sale.user_id|getModelName='User'}&nbsp;&nbsp; &nbsp;&nbsp;创建时间：{$sale.create_time|toDate}
        </td>
</tr>
<tr><td>客户</td><td>
     <input type="hidden" name="customer_id" value="{$sale.customer_id}" >
    {$sale.customer_id|getModelName='Customer'}</td> </tr>
<tr>
	<td class="tRight" >备注:</td>
	<td class="tLeft" >
            {$sale.remark}
        </td>
</tr>
<tr>
    <td class="tRight">可选赠品：</td>
        <td>
            <table class="table  table-bordered table-striped span11" id="checkList">
                <?php $gifts= M('Gift')->where('status = 1')->findAll(); ?>
                <tr> <td> </td> <td colspan="2">赠品组合</td> </tr>
                <volist name="gifts" id="go">
                    <tr>
                        <td><input type="radio" value='{$go.id}' name="gift_id" ></td>
                        <td>{$go.name}</td>
                        <td>
                           <table>
                            <?php $gift_details = M('Gift_detail')->where('gift_id = '.$go['id'])->findAll(); ?>
                            <volist name="gift_details" id="gd">
                                <tr>
                                    <td class="span5">{$gd.goods_id|getModelName='Product'}</td>
                                    <td>{$gd.number}</td>
                                </tr>
                            </volist>
                            </table> 
                        </td>
                    </tr>
                </volist>  
            </table>
        </td>
</tr>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />

<tr>
	<td></td>
	<td class="center" width="300">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
	<a class="btn btn-primary offset1" href="__URL__"><i class="icon-arrow-left icon-white"></i>返回</a>
	</td>
</tr>
</table>
</form>
</div>
</div>

<include file="Public:footer"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/filter-product.js"></script>
